package com.netease.qa.web.controller;

import com.netease.qa.biz.service.UserService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;

/**
 * @author zoudongdong
 * @date 2018/2/18
 */
@Controller
public class IndexController {

    @Resource
    private UserService userService;

    //**********************team*******************************************
    @RequestMapping(value = "/teamListIndex")
    public String teamIndex() {
        return "team/teamList";
    }

    @RequestMapping(value = "/addTeamIndex")
    public String addTeamIndex() {
        return "team/addTeam";
    }

    @RequestMapping(value = "/editTeamIndex/{teamId}")
    public ModelAndView editTeamIndex(@PathVariable int teamId) {
        return new ModelAndView("team/editTeam", "teamId", teamId);
    }

    //**********************project*******************************************
    @RequestMapping(value = "/projectListIndex")
    public String projectListIndex() {
        return "project/projectList";
    }

    @RequestMapping(value = "/addProjectIndex")
    public String addProjectIndex() {
        return "project/addProject";
    }

    @RequestMapping(value = "/editProjectIndex/{projectId}")
    public ModelAndView editProjectIndex(@PathVariable int projectId) {
        return new ModelAndView("project/editProject", "projectId", projectId);
    }

    @RequestMapping(value = "/projectDetailIndex/{projectId}")
    public ModelAndView projectDetailIndex(@PathVariable int projectId) {
        return new ModelAndView("project/projectDetail", "projectId", projectId);
    }

    //**********************testcase*******************************************
    @RequestMapping(value = "/testCaseListIndex")
    public String testCaseListIndex() {
        return "testCase/testCaseList";
    }

    @RequestMapping(value = "/addTestCaseIndex")
    public String addTestCaseIndex() {
        return "testCase/addTestCase";
    }

    @RequestMapping(value = "/editTestCaseIndex/{caseId}")
    public ModelAndView editTestCaseIndex(@PathVariable int caseId) {
        return new ModelAndView("testcase/editTestCase", "caseId", caseId);
    }

    //**********************home*******************************************
    @RequestMapping(value = "/homeIndex")
    public String homeIndex() {
        return "home";
    }

    @RequestMapping(value = "/loginIndex")
    public String loginIndex() {
        return "user/login";
    }

    @RequestMapping(value = "/userRegisterIndex")
    public String userRegisterIndex() {
        return "user/register";
    }
}
